﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ServiceModel;
using PmuRegistry.Data.Entities;
using PmuRegistry.Data.BusinessObjects;
using System.IO;

namespace PmuRegistry.Services.Service
{
	[ServiceContract]
	public interface IPhasorDataService
	{
		[OperationContract]
		[FaultContract(typeof(CustomServiceFault))]
		Dictionary<string, string> GetTimeZones(bool isOptional);

		[OperationContract]
		[FaultContract(typeof(CustomServiceFault))]
		Dictionary<int, string> GetNercRegions(bool isOptional);

		[OperationContract]
		[FaultContract(typeof(CustomServiceFault))]
		Dictionary<int, string> GetDeviceStatuses();

		[OperationContract]
		[FaultContract(typeof(CustomServiceFault))]
		Dictionary<int, string> GetContactTypes();

		[OperationContract]
		[FaultContract(typeof(CustomServiceFault))]
		List<WizardDeviceInfo> GetWizardConfigurationInfo(Stream inputStream);

		[OperationContract]
		[FaultContract(typeof(CustomServiceFault))]
		string SaveWizardConfigurationInfo(List<WizardDeviceInfo> wizardDeviceInfoList, int protocolID, int companyID, int interconnectionID, int? parentID);

		[OperationContract]
		[FaultContract(typeof(CustomServiceFault))]
		string GetExecutingAssemblyPath();

		[OperationContract]
		[FaultContract(typeof(CustomServiceFault))]
		string SaveIniFile(Stream input);

		[OperationContract]
		[FaultContract(typeof(CustomServiceFault))]
		bool UserIsValid(string userName, string password);

        [OperationContract]
        [FaultContract(typeof(CustomServiceFault))]
        Dictionary<int, string> GetFundingSources(bool isOptional);

		#region " Manage Device Code"

		[OperationContract]
		[FaultContract(typeof(CustomServiceFault))]
		List<Device> GetDeviceList();
		
		[OperationContract]
		[FaultContract(typeof(CustomServiceFault))]
		List<Device> GetDeviceListByParentID(int parentID);
		
		[OperationContract]
		[FaultContract(typeof(CustomServiceFault))]
		Dictionary<int, string> GetDevices(DeviceType deviceType, bool isOptional);		

		[OperationContract]
		[FaultContract(typeof(CustomServiceFault))]
		string SaveDevice(Device device, bool isNew, int digitalCount, int analogCount);		

		[OperationContract]
		[FaultContract(typeof(CustomServiceFault))]
		Device GetDeviceByDeviceID(int deviceID);
		
		[OperationContract]
		[FaultContract(typeof(CustomServiceFault))]
		Device GetDeviceByAcronym(string acronym);		

		[OperationContract]
		[FaultContract(typeof(CustomServiceFault))]
		Device GetConcentratorDevice(int deviceID);

		[OperationContract]
		[FaultContract(typeof(CustomServiceFault))]
		List<Device> GetRecentDevices();

		[OperationContract]
		[FaultContract(typeof(CustomServiceFault))]
		Dictionary<string, int> GetReportingPmusStat();

		[OperationContract]
		[FaultContract(typeof(CustomServiceFault))]
		Dictionary<string, int> GetPlannedPmusStat();

		#endregion

		#region " Manage Phasor Code"

		[OperationContract]
		[FaultContract(typeof(CustomServiceFault))]
		List<Phasor> GetPhasorList(int deviceID);		

		[OperationContract]
		[FaultContract(typeof(CustomServiceFault))]
		Dictionary<int, string> GetPhasors(bool isOptional);

		[OperationContract]
		[FaultContract(typeof(CustomServiceFault))]
		Dictionary<int, string> GetPhasorsByDevice(int deviceID, bool isOptional);

		[OperationContract]
		[FaultContract(typeof(CustomServiceFault))]
		string SavePhasor(Phasor phasor, bool isNew);
		
		#endregion

		#region " Manage Measurement Code"

		[OperationContract]
		List<Measurement> GetMeasurementList();

		[OperationContract]
		string SaveMeasurement(Measurement measurement, bool isNew);

		[OperationContract]
		List<Measurement> GetMeasurementsByDevice(int deviceID);
		
		#endregion

		#region " Manage Contacts Code"

		[OperationContract]
		[FaultContract(typeof(CustomServiceFault))]
		string SaveContact(Contact contact, bool isNew);

		[OperationContract]
		[FaultContract(typeof(CustomServiceFault))]
		List<Contact> GetContactList(int companyID);

		[OperationContract]
		[FaultContract(typeof(CustomServiceFault))]
		Dictionary<int, string> GetTechnicalContactByCompany(int companyID, bool isOptional);

		#endregion

		#region " Manage Company Code"

		[OperationContract]
		[FaultContract(typeof(CustomServiceFault))]
		List<Company> GetCompanyList();

		[OperationContract]
		[FaultContract(typeof(CustomServiceFault))]
		Dictionary<int, string> GetCompanies(bool isOptional);

		[OperationContract]
		[FaultContract(typeof(CustomServiceFault))]
		string SaveCompany(Company company, bool isNew);

		#endregion

		#region " Manage Vendor Code"

		[OperationContract]
		[FaultContract(typeof(CustomServiceFault))]
		List<Vendor> GetVendorList();

		[OperationContract]
		[FaultContract(typeof(CustomServiceFault))]
		Dictionary<int, string> GetVendors(bool isOptional);

		[OperationContract]
		[FaultContract(typeof(CustomServiceFault))]
		string SaveVendor(Vendor vendor, bool isNew);

		#endregion

		#region " Manage Vendor Device Code"

		[OperationContract]
		[FaultContract(typeof(CustomServiceFault))]
		List<VendorDevice> GetVendorDeviceList();

		[OperationContract]
		[FaultContract(typeof(CustomServiceFault))]
		string SaveVendorDevice(VendorDevice vendorDevice, bool isNew);

		[OperationContract]
		[FaultContract(typeof(CustomServiceFault))]
		Dictionary<int, string> GetVendorDevices(bool isOptional);

		#endregion

		#region " Manage Interconnection Code"

		[OperationContract]
		[FaultContract(typeof(CustomServiceFault))]
		Dictionary<int, string> GetInterconnections(bool isOptional);

		#endregion

		#region " Manage Protocols Code"

		[OperationContract]
		[FaultContract(typeof(CustomServiceFault))]
		Dictionary<int, string> GetProtocols(bool isOptional);

		#endregion

		#region " Manage Signal Types Code"

		[OperationContract]
		[FaultContract(typeof(CustomServiceFault))]
		Dictionary<int, string> GetSignalTypes(bool isOptional);

		#endregion

		#region " Manage Network Model Code"

		[OperationContract]
		[FaultContract(typeof(CustomServiceFault))]
		List<NetworkModel> GetNetworkModelList();

		[OperationContract]
		[FaultContract(typeof(CustomServiceFault))]
		Dictionary<int, string> GetNetworkModels(bool isOptional);

		[OperationContract]
		[FaultContract(typeof(CustomServiceFault))]
		string SaveNetworkModel(NetworkModel model, bool isNew);

		#endregion

		#region " Manage User Comment Code"

		[OperationContract]
		[FaultContract(typeof(CustomServiceFault))]
		List<UserComment> GetUserCommentList();

		[OperationContract]
		[FaultContract(typeof(CustomServiceFault))]
		string SaveUserComment(UserComment comment);

		#endregion
	}
}
